package com.fishery.monitor.dao;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fishery.monitor.mapper.MonitorWaterDataMapper;
import com.fishery.monitor.pojo.Warning;
import com.fishery.monitor.pojo.WaterData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
@Component
public class WaterDataDao {

    @Autowired
    MonitorWaterDataMapper monitorWaterDataMapper;

    public IPage<WaterData> findAll(Page<WaterData> page, QueryWrapper<WaterData> wrapper) {
        return  monitorWaterDataMapper.selectPage(page,wrapper);
    }

    public List<WaterData> findAll(QueryWrapper<WaterData> wrapper) {
        return  monitorWaterDataMapper.selectList(wrapper);
    }

    public WaterData findById(String id) {
        return (WaterData)this.monitorWaterDataMapper.selectById(id);
    }

    public void update(WaterData waterData) {
        this.monitorWaterDataMapper.updateById(waterData);
    }
}
